package org.tang.springcloudvv.gateway.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.tang.springcloudvv.gateway.service.DiscoveryClientService;

import java.util.List;

//tangfuzhong
@RestController
public class CommonController {

	@Autowired
	private DiscoveryClientService discoveryClientService;


	private Logger logger = LoggerFactory.getLogger(this.getClass());

	public CommonController()
	{
		logger.info("init CommonController");
	}

	//尝试查询当前实例的服务列表
	@RequestMapping(value = "/common/serverList", method = RequestMethod.GET)
	public List<Object> getServerList() {
		return discoveryClientService.getServerList();
	}


}